package com.example.finalframe.service.factory;

import com.example.finalframe.service.impl.LoginUseNamePasswordImpl;
import com.example.finalframe.service.impl.LoginUsePhonePasswordImpl;
import com.example.finalframe.service.intf.LoginIntf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class LoginFactory {
    @Autowired
    private LoginUseNamePasswordImpl loginUseNamePassword;

    @Autowired
    private LoginUsePhonePasswordImpl loginUsePhonePassword;


    public LoginIntf createLogin(String loginType) {
        if ("UsernamePassword".equalsIgnoreCase(loginType)) {
            return loginUseNamePassword;
        } else if ("PhonePassword".equalsIgnoreCase(loginType)) {
            return loginUsePhonePassword;
        }
        return null;
    }
}
